

const str = console.log`hello world`;//打印的是数组

const name = 'tom';
const gender = true;

function tag(str, name, gender) {
  console.log(str)//分割成数组
  const sex = gender ? 'man' : 'woman';//可添加修饰
  return str[0] + name + str[1] + sex;
}

const result = tag`hey,${name} is a ${gender}`;

console.log(result)